package com.learn.finished;

import java.util.Arrays;

public class num_1877 {
    class Solution {
        public int minPairSum(int[] nums) {
            Arrays.sort(nums);
            int n = nums.length;
            int ans = nums[0] + nums[n - 1];
            for (int i = 0, j = n - 1; i < j; i++, j--) {
                ans = Math.max(ans, nums[i] + nums[j]);
            }
            return ans;
        }
    }
}
